Skip to content

Update 3.3-di-changes.rst #10313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed

Conversation

DonCallisto
Copy link
Contributor

Looking at deprecations of 4.2, I noticed that extending AbstractController will prevent you from getting the services (even public ones) from container. This should be reported.

Looking at deprecations of 4.2, I noticed that extending `AbstractController` will prevent you from getting the services (even public ones) from container. This should be reported.

If you get rid of deprecations and extend `AbstractController` instead of `Controller` for
your controllers, you can skip the rest of this step as `AbstractController` won't provide
a containe where you can get the services directly. All services need to be injected as
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

containe -> container


.. note::

If you get rid of deprecations and extend `AbstractController` instead of `Controller` for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the RST format used in Symfony Docs, code uses two backticks instead of one (like in Markdown):

... ``AbstractController`` instead of ``Controller`` ...

If you get rid of deprecations and extend `AbstractController` instead of `Controller` for
your controllers, you can skip the rest of this step as `AbstractController` won't provide
a containe where you can get the services directly. All services need to be injected as
explained in `Step 5 Cleanup`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a link to an absolute URL, we can link to a specific part of this article. First, change the link of this line by this:

explained in the :ref:`step 5 of this article <step-5>`.

Then, in the line 718 of this article, add the following reference before Step 5) Cleanup!:

.. _step-5:

Step 5) Cleanup!
~~~~~~~~~~~~~~~~

...

Finally, you can remove this link at the bottom of the article: .. _Step 5 Cleanup: https://github.com/symfony/symfony-docs/blob/master/service_container/3.3-di-changes.rst#step-5-cleanup

@DonCallisto
Copy link
Contributor Author

@javiereguiluz is it ok now?

@javiereguiluz
Copy link
Member

Almost OK :) The last thing is to add the .. _step-5: reference in the article, just above the Step 5 title. Like this:

.. _step-5:

Step 5) Cleanup!
~~~~~~~~~~~~~~~~

[...]

@DonCallisto
Copy link
Contributor Author

Done! 😃

@javiereguiluz javiereguiluz added this to the 3.4 milestone Sep 11, 2018
javiereguiluz added a commit that referenced this pull request Sep 11, 2018
This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #10313).

Discussion
----------

Update 3.3-di-changes.rst

Looking at deprecations of 4.2, I noticed that extending `AbstractController` will prevent you from getting the services (even public ones) from container. This should be reported.

<!--

If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/roadmap for the list of maintained branches).

If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `master` for features of unreleased versions).

-->

Commits
-------

f16e631 Update 3.3-di-changes.rst
@javiereguiluz
Copy link
Member

javiereguiluz commented Sep 11, 2018

@DonCallisto thanks for improving the docs and for your patience during the review process!

Note: GitHub shows this PR as "closed" instead of "merged" because we squashed your commits while merging ... but it's "merged".

@DonCallisto
Copy link
Contributor Author

Thank you for guiding me. Cheers 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants